<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
     <!--switch 一段语句循环 -->
   <!--   <input type="text" value="" id="yj">
     <input type="button" value="点击" id="bnt" style="display: block;"> -->
 
  <!--   switch 循环 星期几 -->
    <p id="demo"> </p>

     <!-- 计算器 单选 -->
    <input type="text" id="ip1" value="" placeholder="请输入第一个值">
    <label><input type="radio" id="b" name="io">+</label>
    <label><input type="radio" id="c" name="io">-</label>
    <label><input type="radio" id="e" name="io">*</label>
    <label><input type="radio" id="f" name="io">/</label>
    <label><input type="radio" id="g" name="io">%</label>
    <input type="text" id="ip2" value="" placeholder="请输入第二个值">
    <input type="button" id="dy" value="=">
    <input type="text" id="ip3" value="" placeholder="结果">

    <script>

    //计算器 switch case
      var b1 = parseFloat(prompt('请输入第一个值'));
         var b2 = parseFloat(prompt('请输入第二个值'));
         var c = prompt('请选择输入的符号  + - * / %');
         switch (c) {
             case '+':
                 alert(b1 + b2)
                 break;
             case '-':
                 alert(b1 - b2)
                 break;
             case '*':
                 alert(b1 * b2)
                 break;
             case '/':
                 alert(b1 / b2)
                 break;
             case '%':
                 alert(b1 % b2)
                 break;
             default:alert('输入错误')
         } 



//switch    今天是周几
// var x=2;
// switch (x) {
//   case 2:
//     text = "今天是周六";
//     break;
//   case 0:
//     text = "今天是周日";
//     break;
//   default:
//     text = "期待周末";
// }
// document.getElementById("demo").innerHTML =text;



        
        //switch 一段英文循环
       /*  bnt.onclick = function () {
            var bn = parseFloat(yj.value)

            
                switch (bn) {
                    case 0:
                        console.log('So');

                    case 1:
                        console.log('What');

                    case 2:
                        console.log('Is');
                    case 3:
                        console.log('Your');
                    case 4:
                        console.log('name');
                    case 5:
                        console.log('?')
                        break;
                    default:console.log('输入错误')
                    
                      

                }
              } */
            
        //买水果价格  switch
        /*   var a = prompt('请输入您想买的水果')
          switch (a) {
              case '红提':
                  alert('红提为18元/斤')
                  break;
              case '荔枝':
                  alert('荔枝为25元/斤')
                  break;
              case '甘蔗':
                  alert('甘蔗为12元/斤')
                  break;
              case '丑橘':
                  alert('丑橘为23元/斤')
                  break;
              case '火龙果':
                  alert('火龙果为14元/斤')
                  break;
              default:alert('没有此种水果')
          } */
      
    </script>
</body>
</html>